﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Reticulum
{
    public partial class Loads : Form
    {
        public static Client client = null;
        public Loads()
        {
            InitializeComponent();
        }

        private void Load_Load(object sender, EventArgs e)
        {
            panel2.Width = 0;
            if (panel2.Width == 0)
            {
                timer1.Start();
            }
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            if (panel2.Width < 50)
            {
                label1.Text = "初始化云盘.....【完成】";
                panel2.Width += 10;
            }
            else if (panel2.Width >= 50 && panel2.Width < 100)
            {
                label1.Text = "访问数据库......【完成】";
                panel2.Width += 50;
            }
            else if (panel2.Width >= 100 && panel2.Width < 200)
            {
                label1.Text = "获取用户数据......【完成】";
                panel2.Width += 50;
            }
            else if (panel2.Width >= 200 && panel2.Width < 250)
            {
                label1.Text = "加载显示文件视图......【完成】";
                panel2.Width += 10;
            }
            else
            {
                label1.Text = "解析文件......【完成】";
                panel2.Width += 220;
                if (panel2.Width >= 470)
                {
                    timer1.Stop();
                    
                    this.Hide();
                    client = new Client();
                    client.ShowDialog();
                    this.Close();
                }
            }
        }

        
    }
}
